import { createRouter, createWebHashHistory } from 'vue-router'
//路由懒加载
// @ts-ignore
const Home = () => import('../views/home/index.vue')
// @ts-ignore
const Login = () => import('../views/login/index.vue')
// @ts-ignore
const Music = () => import('../views/home/components/music/index.vue')
// @ts-ignore
const Video = () => import('../views/home/components/video/index.vue')
// @ts-ignore
const TestPractise = () => import('../views/information/informationTest/testPractise.vue')
// @ts-ignore
const CanvasTable = () => import('../views/information/canvasTable/CanvasTable.vue')

//createRouter 创建路由方法
const router = createRouter({
    //createWebHashHistory 创建history路由模式方法
    history: createWebHashHistory(),
    //配置路由表
    routes: [
        {
            path: '/',
            component: Home,
            // title:'路由元页面'
        },
        {
            path: '/home',
            component: Home,
            name: 'Home',
            children: [
                {
                    path: 'music',
                    component: Music,
                    name: 'Music',
                },
                {
                    path: 'video',
                    component: Video,
                    name: 'Video',
                },
            ]
        },
        {
            path: '/login',
            component: Login,
            name: 'Login',
        },
        {
            path: '/testPractise',
            component: TestPractise,
            name: 'TestPractise',
        },
        {
            path: '/canvasTable',
            component: CanvasTable,
            name: 'canvasTable',
        }
    ]
})
export default router;
